/*
* Portuguese eID Card API .NET Wrapper
*
* Written by Fernando Nunes (fernando.nunes@devscope.net)
* Copyright (c) 2009 DevScope Information Systems
*
* This library is free software; you can redistribute it and/or 
* modify it under the terms of the GNU Lesser General Public 
* License as published by the Free Software Foundation; either 
* version 2.1 of the License, or (at your option) any later version. 
* 
* This library is distributed in the hope that it will be useful, 
* but WITHOUT ANY WARRANTY; without even the implied warranty of 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
* Lesser General Public License for more details. 
* 
* You should have received a copy of the GNU Lesser General Public 
* License along with this library; if not, write to the Free Software 
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 
*/

#pragma once
#include "Stdafx.h"
#include "Picture.h"
#include "Interop.h"

using namespace System;
using namespace DevScope::CartaoDeCidadao;

Picture::Picture(const PTEID_PIC& i)
{
	this->Version = i.version;
	this->cbeff = ArrayUnmanagedToManaged<unsigned char, unsigned char>((unsigned char*)i.cbeff, static_cast<int>(strlen((char*)i.cbeff)));
	this->FacialRechdr = ArrayUnmanagedToManaged<unsigned char, unsigned char>((unsigned char*)i.facialrechdr, static_cast<int>(strlen((char*)i.facialrechdr)));
	this->FacialInfo = ArrayUnmanagedToManaged<unsigned char, unsigned char>((unsigned char*)i.facialinfo, static_cast<int>(strlen((char*)i.facialinfo)));
	this->ImageInfo = ArrayUnmanagedToManaged<unsigned char, unsigned char>((unsigned char*)i.imageinfo, static_cast<int>(strlen((char*)i.imageinfo)));
	this->Bytes = ArrayUnmanagedToManaged<unsigned char, unsigned char>((unsigned char*)i.picture, i.piclength);
	this->BytesLength = i.piclength;
}